<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>注册网站</title>
    <script>//检查两次输入密码是否一致
        function checkForm(){
            var pw1 = document.getElementById("pw1").value;
            var pw2 = document.getElementById("pw2").value;
            if(pw1 !== pw2){
                alert('两次输入密码不一致！');
                return false;
            }
            return true;
        }
    </script>
</head>
<body>
<form method="post" action="register.php" onsubmit="return checkForm()" >
    <table>
        <tr><th>用户名：</th><td><input type="text" name="username" /></td></tr>
        <tr><th>邮箱：</th><td><input type="text" name="email" /></td></tr>
        <tr><th>密码：</th><td><input type="password‘’" name="password" /></td></tr>
        <tr><th>确定密码：</th><td><input type="password" name="password" /></td></tr>
        <tr> <td><input type="submit" value="提交注册"/></td>
           <td> <input type="reset" value="重新填写"/> </td>
        </tr>
    </table>
</form>
</body>
</html>